<template>
	<view class="container" style="background-color: #ffaa00;height: 100vh;padding-top: 60rpx;">
		<view style="width: 690rpx;margin-left: 30rpx;background-color: #FFF;padding-bottom: 60rpx;border-radius: 12rpx;">
			<view style="padding-top: 40px;display: flex;flex-direction: column;align-items: center;">
				<view>{{ shopName }}</view>
				<image style="width: 480rpx;height: 480rpx;" :show-menu-by-longpress="true" :src="'data:image/png;base64,' + base64_code" mode="aspectFill"></image>
			</view>
			<view style="width: 250rpx;margin-top: 40rpx;margin-left: 250rpx;">
				长按保存二维码
			</view>
		</view>
	</view>
</template>

<script>
	import { shop } from '@/api/shop.js'
	import { common } from '@/api/common.js'
	export default{
		components: {},
		data() {
			return {
				shopId: '',
				shopName: '',
				base64_code: '',
				regUrl: '',
				clientInfo: {}
			}
		},
		onLoad() {
			this.shopId = this.$Route.query.shopId
			this.shopName = this.$Route.query.shopName
			this.clientInfo = this.$storage.getStorageDataSync(this.$store.state.clientname)
			this.regUrl = this.clientInfo.baseUrl + '?clientname='+this.$store.state.clientname + '&CHN=shopReceivingQrcode' + '&parentCode=' + this.$storage.getStorageDataSync(this.$store.state.userInfo).code + '&shop=' + this.shopId + '&shopName=' + this.shopName
			this.createCode(this.regUrl)
		},
		// onShareAppMessage(res) {
		// 	return {
		// 		title: '',
		// 		path:  '/pageA/merchant/shopHome'+ '?shop=' + this.shopId
		// 	}
		// },
		methods:{
			createCode(content) {
				common.createCode({
					content: content 
				}).then(res => {
					if (res.data.code == 10000) {
						this.base64_code = res.data.data
					}
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	
</style>
